import request from "@/utils/request";

// 查询用户列表
export function listNjtUserRegister(query) {
  return request({
    url: "/nongjt/userRegister/list",
    method: "get",
    params: query,
  });
}

export function updateNjtUserRegister(data) {
  return request({
    url: "/nongjt/userRegister/update",
    method: "put",
    data: data,  //使用请求体携带JSON对象数据到后端
  });
}

export function deleteNjtUserRegister(data) {
  return request({
    url: '/nongjt/userRegister/delete', // 注意路径
    method: 'delete', // 注意HTTP方法
    data: data // data是 { ids: [1, 2, 3] }
  })
}

// 根据年份获取饼状图数据
export function getPieDataByYear(year) {
  return request({
    url: '/njt/stats/pie/' + year,
    method: 'get'
  })
}

// 根据年份获取柱状图数据
export function getBarDataByYear(year) {
  return request({
    url: '/njt/stats/bar/' + year,
    method: 'get'
  })
}
